package domain;
// Generated 08-jul-2009 18:53:47 by Hibernate Tools 3.2.1.GA


import java.sql.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Mortgageconsumption generated by hbm2java
 */
@Entity
@Table(name="mortgageconsumption"
    ,catalog="domeco"
)
public class Mortgageconsumption  implements java.io.Serializable {


     private Integer idMortgageCons;
     private Invoice invoice;
     private Consumption consumption;
     private Date dateFrom;
     private Date dateTo;

    public Mortgageconsumption() {
    }

    public Mortgageconsumption(Invoice invoice, Consumption consumption, Date dateFrom, Date dateTo) {
       this.invoice = invoice;
       this.consumption = consumption;
       this.dateFrom = dateFrom;
       this.dateTo = dateTo;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="idMortgageCons", unique=true, nullable=false)
    public Integer getIdMortgageCons() {
        return this.idMortgageCons;
    }
    
    public void setIdMortgageCons(Integer idMortgageCons) {
        this.idMortgageCons = idMortgageCons;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="invoiceFK", nullable=false)
    public Invoice getInvoice() {
        return this.invoice;
    }
    
    public void setInvoice(Invoice invoice) {
        this.invoice = invoice;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="consFK", nullable=false)
    public Consumption getConsumption() {
        return this.consumption;
    }
    
    public void setConsumption(Consumption consumption) {
        this.consumption = consumption;
    }
    @Temporal(TemporalType.DATE)
    @Column(name="dateFrom", nullable=false, length=10)
    public Date getDateFrom() {
        return this.dateFrom;
    }
    
    public void setDateFrom(Date dateFrom) {
        this.dateFrom = dateFrom;
    }
    @Temporal(TemporalType.DATE)
    @Column(name="dateTo", nullable=false, length=10)
    public Date getDateTo() {
        return this.dateTo;
    }
    
    public void setDateTo(Date dateTo) {
        this.dateTo = dateTo;
    }




}


